import { BaseService, CoolCommException } from "@cool-midway/core";
import { Provide } from "@midwayjs/core";
import { InjectEntityModel } from "@midwayjs/typeorm";
import { Equal, Repository } from "typeorm";
import { ProviderInfoEntity } from "../entity/info";

@Provide()
export class ProviderInfoService extends BaseService {
    @InjectEntityModel(ProviderInfoEntity)
    providerInfoEntity: Repository<ProviderInfoEntity>;


    async isExitPhone(phone: string) {
        return await this.providerInfoEntity.exists({
            where: { phone: Equal(phone) },
        });
    }

}